package com.liaoct.lct.listener;

import android.support.v4.view.ViewPager;
import android.view.View;
import android.view.View.OnClickListener;

/**
 * 小圆点点击监听类
 * 
 * @author liaoct
 * 
 */
public class RoundDotClickListener implements OnClickListener {

	private ViewPager viewPager;

	/**
	 * 小圆点对应大图片的索引
	 */
	private int index;

	public RoundDotClickListener(int index, ViewPager viewPager) {
		this.index = index;
		this.viewPager = viewPager;
	}

	@Override
	public void onClick(View v) {
		if (viewPager != null) {
			viewPager.setCurrentItem(this.index);
		}
	}

}